{include file='pub/header'/}
<title>添加活动</title>
</head>
<body>
<div class="page-container">
	<form class="form form-horizontal" id="charge_form" action="{:url('Marketing/charge_add')}" method="post">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>充值金额：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" name="money">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>赠送金额：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" name="given_money">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>是否开启：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<label><input type="radio" name="status" value="1" checked/>开启</label>
				<label><input type="radio" name="status" value="0"/>关闭</label>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button class="btn btn-secondary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存设置</button>
			</div>
		</div>
	</form>
</div>
{include file="pub/footer"/}
<script type="text/javascript">
$(function(){
    $("#charge_form").validate({
		rules:{
		    money: {
		        required:true,
                number: true
			},
			given_money:{
		        required:true,
				number: true
			}
		},
		messages:{
            money:{
                required:'活动名称不能为空'
            },
            given_money:{
                required:'赠送金额不能为空'
            }
		},
        onkeyup:false,
        focusCleanup:true,
        success: 'valid',
		submitHandler:function(form){
            $(form).ajaxSubmit(function(res){
                if(res.code == 1){
                    parent.location.reload();
                    layer_close();
                }else{
                    layer.alert(res.msg);
                }
            });
		}
	});
});
</script>
</body>
</html>